<?php
/**
 *
 * Author 凡墙<jihaoju@qq.com>.
 * Date: 2015/11/4
 * Time: 15:51
 */

namespace app\common\com\disLock;


interface DisLock
{

	/**
	 * 加锁
	 * @param string $key 锁key
	 * @param int $timeout	锁超时时间
	 * @return boolean
	 */
	public function lock($key, $timeout = 0);

	/**
	 * 释放锁
	 * @param string $key 锁key
	 * @return boolean
	 */
	public function unlock($key);

	/**
	 * 检测是否为加锁状态
	 * @param string $key
	 * @return boolean
	 */
	public function recover($key);

}